<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
<head>
<meta charset="UTF-8">
<title>Spring boot</title>
<script type="text/javascript" src="static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
//查询的内容
function quary(){
    var str = $("#username").val();
     $.ajax({
        url:"/search",
        dataType : "json",
        success : function(data) {
            //i循环的次数  value对象 id,name等是属性 <接收list>
            $.each(data, function(i, value) {                          
                        $("#remark").append(
                         " <tr><td>" + value.userid + "</td><td>"
                                + value.username + "</td><td>" + value.usersex
                                + "</td><td>" + value.userdate + "</td></tr>"); 
            }); 
        },
        error:function(){
            alert("没有找到此人");
        }
    }); 
}

</script>
</head>
<body>
    <form action="">
        查询:<input type="button" id="username" onclick="quary()"/>
        <table class="table table-striped" id="remark">
        <tr>
            <td>id</td>
            <td>名字</td>
            <td>年龄</td>
            <td>**</td>
        </tr>
    </table>
    </form>
</body>
</html>
